package cn.edu.scau.cmi.yangqing.comprehension.client;

import java.net.URL;
import java.util.ResourceBundle;

import cn.edu.scau.cmi.yangqing.client.AbstractFactoryClient;
import cn.edu.scau.cmi.yangqing.client.ClassAdapterClient;
import cn.edu.scau.cmi.yangqing.client.ComprehensionJavaFxClient;
import cn.edu.scau.cmi.yangqing.client.FactoryPatternClient;
import cn.edu.scau.cmi.yangqing.client.HibernateClient;
import cn.edu.scau.cmi.yangqing.client.MutilClient;
import cn.edu.scau.cmi.yangqing.client.ObjAdapterClient;
import cn.edu.scau.cmi.yangqing.client.SimpleFactoryMethodClient;
import cn.edu.scau.cmi.yangqing.client.SingletonClient;
import cn.edu.scau.cmi.yangqing.client.SpringClientJavaFX;
import cn.edu.scau.cmi.yangqing.client.composite_consistencyClient;
import cn.edu.scau.cmi.yangqing.client.composite_safeClient;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class MyController implements Initializable {

	
	
	@FXML
	private Button single;
		
	@FXML
	private Button mutil;
	
	@FXML
	private Button simpleFactory;
		
	@FXML
	private Button factory;
	
	@FXML
	private Button abstractFactory;
		
	@FXML
	private Button objAdapter;
	
	@FXML
	private Button classAdapter;
		
	@FXML
	private Button safe;
	
	@FXML
	private Button consistency;
		
	@FXML
	private Button hibernate;
	
	@FXML
	private Button spring;
		
	@FXML
	private Button hibernate_spring;
	   
   public void initialize(URL location, ResourceBundle resources) { }
	
   public void single(ActionEvent event) {
	   SingletonClient singletonClient = new SingletonClient();
	   Stage primaryStage = new Stage();
	   singletonClient.start(primaryStage );
   }
   
   public void mutil(ActionEvent event) {
	    MutilClient mutilClient = new MutilClient();
	    Stage stage = new Stage();
	    mutilClient.start(stage);
   }
   public void simpleFactory(ActionEvent event) {
	   SimpleFactoryMethodClient client = new SimpleFactoryMethodClient();
	   Stage stage = new Stage();
	   client.start(stage);
   }
   
   public void factory(ActionEvent event) throws Exception {
	   FactoryPatternClient client1 = new FactoryPatternClient();
	   Stage stage = new Stage();
	   client1.start(stage);
   }
	  
   public void abstractFactory(ActionEvent event) {
	   AbstractFactoryClient client = new AbstractFactoryClient();
	   Stage stage = new Stage();
	   client.start(stage);
   }
   
   public void objAdapter(ActionEvent event) {
	    ObjAdapterClient client = new ObjAdapterClient();
	    Stage stage = new Stage();
	    client.start(stage);
   }
   public void classAdapter(ActionEvent event) {
	   ClassAdapterClient client = new ClassAdapterClient();
	   Stage stage = new Stage();
	   client.start(stage);
   }
   
   public void safe(ActionEvent event) {
	    composite_safeClient client = new composite_safeClient();
	    Stage stage = new Stage();
	    client.start(stage);
   }
   
   public void consistency(ActionEvent event) {
	   composite_consistencyClient client = new composite_consistencyClient();
	   Stage stage = new Stage();
	   client.start(stage);
   }
   
   public void hibernate(ActionEvent event) {
	    HibernateClient client = new HibernateClient();
	    Stage stage = new Stage();
	    client.start(stage);
   }
   public void spring(ActionEvent event) {
	   SpringClientJavaFX clientJavaFX = new SpringClientJavaFX();
	   Stage stage = new Stage();
	   clientJavaFX.start(stage);
   }
   
   public void hibernate_spring(ActionEvent event) {
	    ComprehensionJavaFxClient cliFx = new ComprehensionJavaFxClient();
	    Stage stage = new Stage();
	    cliFx.start(stage);
   }
}
